package passworks.Gates;

import passworks.*;

public class AND extends GateBase {

    public static int ID = 0;

    public AND() {

        className = "AND";
        ownID = ID;

        Logger.Print(className, className, Direction.IN, ownID);
        Logger.Print(className, className, Direction.OUT, ownID);

        ID++;
    }

    public void SetOutputs() {
        Logger.Print(className, "SetOutputs", Direction.IN, ownID);
        /*
         * Bemenetek lekerdezese
         */
        for(Wire w : input) {
            w.GetState();
        }
        /*
         * Tenyleges logika (...)
         */

        /*
         * Kimenetek beallitasa
         */
        for(Wire w : output) {
            w.SetStable(true);
            w.SetState(false);
        }

        Logger.Print(className, "SetOutputs", Direction.OUT, ownID);
    }

    public void Init() {
        Logger.Print(className, "Init", Direction.IN, ownID);
        Logger.Print(className, "Init", Direction.OUT, ownID);
    }
}
